package h_arrayMethod;

import java.util.Arrays;

public class Demo {
    public static void main(String[] args) {

        //lambda表达式的写法
        int[] ints = arrBuilder(10, n -> new int[n]);
        System.out.println(Arrays.toString(ints));//[0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
        //遍历ints 进行赋值操作

        //方法引用
        arrBuilder(5,int[] :: new);

    }

    //方法,方法的参数就是函数式接口
    public static int[] arrBuilder(int n,ArrayBuilder ab){
        return ab.builderArray(n);
    }
}
